<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/com/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/doctype.jspf" %>

<script type="text/javascript" src="<c:url value='/common/js/jquery-1.7.1.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-ui-1.8.16.custom.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-popup.0.2.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/ajaxupload.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/Common.js'/>"></script>
<script type="text/javascript" language = "javascript">

document.domain="hyundai.com" ;
function PopUpClose(){
  /*
    var zipCodePopup = new jQuery.Popup().closePopup('zipCode');     
  */
 // var objOpener = opener.document.newMbrAddInfoForm;
    self.close();
}


function  MenuTgl(tglFlg){
    var newZipCode = document.getElementById("newZipCode");
    var oldZipCode = document.getElementById("oldZipCode");
    
    if(tglFlg == 1){
        newZipCode.style.display = "block";
        oldZipCode.style.display = "none";
    }else if (tglFlg == 2){
        newZipCode.style.display = "none";
        oldZipCode.style.display = "block";        
    }
}


$(document).ready(
        function() {
          
            fnSearchWpaList();
        }
);


function fnSearchWpaList()
{
   
   var gCd = "ZIP_WPA";

    $.post("<c:url value='/zip/selectWpaList.do'/>",
            {
                'gCd' : gCd   
            },
            function(data){
                var WpaList=[];
                var items = $(data).find("item");
                var ite = items.size();
                items.each(function(index,element){
                   var object={};
                   var wpaCd = $(this).find("value").eq(0).text();
                   var wpaNm = $(this).find("value").eq(1).text();
                   object["code"] = wpaCd;
                   object["name"] = wpaNm;

                   WpaList[index] = object;
                });
               
                if(WpaList.length > 0){
                    //신주소
                    $('#newWpaCode').find("option").remove();
                    $('#newWpaCode').append('<option value="" selected>선택</option>');
                    //구주소
                    $('#oldWpaCode').find("option").remove();
                    $('#oldWpaCode').append('<option value="" selected>전체</option>');
                    
                    
                    for(var i=0; i<WpaList.length; i++){
                        //신주소
                        $('#newWpaCode').append('<option value="'+WpaList[i]["code"]+'">'+WpaList[i]["name"]+'</option>');
                        //구주소
                        $('#oldWpaCode').append('<option value="'+WpaList[i]["name"]+'">'+WpaList[i]["name"]+'</option>');
}
              
                }
                else{
                    //신주소
                    $('#newWpaCode').find("option").remove();
                    $('#newWpaCode').append('<option value="">선택</option>');
                    //구주소
                    $('#oldWpaCode').find("option").remove();
                    $('#oldWpaCode').append('<option value="">전체</option>');
                
                
                }
            }
        );    
    
    MenuTgl('1');
}

function searchNewAdmz(){
    var wpaCd = document.getElementById("newWpaCode");
    
    if(wpaCd.value == ""){
        //[선택]을 선택한경우 시군구를 초기화 해야한다.
                    //신주소
        $('#newAdmzCode').find("option").remove();
        $('#newAdmzCode').append('<option value="">선택</option>');
        return;
    }
    
    if(wpaCd.value == "세종특별자치시"){
        var newCodeYn1 = document.getElementById("newCodeYn1");
        var newCodeYn2 = document.getElementById("newCodeYn2");
        newCodeYn1.style.display = "none";
        newCodeYn2.style.display = "none";
        return;
    }else{
        var newCodeYn1 = document.getElementById("newCodeYn1");
        var newCodeYn2 = document.getElementById("newCodeYn2");
        newCodeYn1.style.display = "block";
        newCodeYn2.style.display = "block";
    }
    
    //시,군,구를 조회해 온다.
    $.post("<c:url value='/zip/selectNewAdmzList.do'/>",
            {
                'wpaCd' : wpaCd.value   
            },
            function(data){
                var AdmzList=[];
                var items = $(data).find("item");
                var ite = items.size();
                items.each(function(index,element){
                   var object={};
                   var wpaCd = $(this).find("value").eq(0).text();
                   var wpaNm = $(this).find("value").eq(1).text();
                   object["code"] = wpaCd;
                   object["name"] = wpaNm;

                   AdmzList[index] = object;
                });
               
                if(AdmzList.length > 0){
                    //신주소
                    $('#newAdmzCode').find("option").remove();
                    $('#newAdmzCode').append('<option value="" selected>선택</option>');

                    
                    
                    for(var i=0; i<AdmzList.length; i++){
                        //신주소
                        $('#newAdmzCode').append('<option value="'+AdmzList[i]["code"]+'">'+AdmzList[i]["name"]+'</option>');
                       }
              
                }
                else{
                    //신주소
                    $('#newAdmzCode').find("option").remove();
                    $('#newAdmzCode').append('<option value="">선택</option>');
               
                }
            }
        );    
    
}


function searchOldAdmz(){
    var wpaCd = document.getElementById("oldWpaCode");
    
    if(wpaCd.value == ""){
        //[선택]을 선택한경우 시군구를 초기화 해야한다.
        $('#oldAdmzCode').find("option").remove();
        $('#oldAdmzCode').append('<option value="">전체</option>');

        return;
    }
    
    if(wpaCd.value == "세종"){
        var oldCodeYn1 = document.getElementById("oldCodeYn1");
        var oldCodeYn2 = document.getElementById("oldCodeYn2");
        oldCodeYn1.style.display = "none";
        oldCodeYn2.style.display = "none";
        return;
    }else{
        var oldCodeYn1 = document.getElementById("oldCodeYn1");
        var oldCodeYn2 = document.getElementById("oldCodeYn2");
        oldCodeYn1.style.display = "block";
        oldCodeYn2.style.display = "block";
    }
    
    //시,군,구를 조회해 온다.
    $.post("<c:url value='/zip/selectOldAdmzList.do'/>",
            {
                'wpaCd' : wpaCd.value   
            },
            function(data){
                var AdmzList=[];
                var items = $(data).find("item");
                var ite = items.size();
                items.each(function(index,element){
                   var object={};
                   var wpaCd = $(this).find("value").eq(0).text();
                   var wpaNm = $(this).find("value").eq(1).text();
                   object["code"] = wpaCd;
                   object["name"] = wpaNm;

                   AdmzList[index] = object;
                });
               
                if(AdmzList.length > 0){
                    //구주소
                    $('#oldAdmzCode').find("option").remove();
                    $('#oldAdmzCode').append('<option value="" selected>전체</option>');

                    
                    
                    for(var i=0; i<AdmzList.length; i++){
                        //구주소
                        $('#oldAdmzCode').append('<option value="'+AdmzList[i]["code"]+'">'+AdmzList[i]["name"]+'</option>');
                       }
              
                }
                else{
                    //구주소
                    $('#oldAdmzCode').find("option").remove();
                    $('#oldAdmzCode').append('<option value="">전체</option>');
               
                }
            }
        );    
    
}

/*신주소 우편번호를 조회한다*/
function searchNewAdr(){
    
    var wpaCd = document.getElementById("newWpaCode");
    var admCd = document.getElementById("newAdmzCode");
    var newRdNm = document.getElementById("newRdNm");


    
    if(wpaCd.value == ""){
        alert("시/도를 선택하여 주십시요");
        wpaCd.focus();
        return ;
    }
	if(wpaCd.value == "세종특별자치시") {
        
    } else {
        if(admCd.value == ""){
            alert("시/군/구를 선택하여 주십시요");
            admCd.focus();
            return ;
        }
    }
    
    if(newRdNm.value ==""){
        alert("도로명 + 건물번호를 입력하여 주십시요");
        

        newRdNm.focus();
        return ;
    }

    // 건물명의 오류를 검증하고 정확한 조회 건물명을 조합한다.
    var rst = newRdNmCheck (newRdNm.value);
    
    if (rst == -1){
         newRdNm.focus();
         return ;
    }

    
    var searchRdNm = document.getElementById("searchRdNm");    
    
    
    searchRdNm.value = rst ;
    

    
 
    
    
    searchNewAdrDtl();
    
}


/*
 * 이 함수는 도로명을 체크하는 부분이다.
 * 도로명에 오류가 있으면  체크후 -1을 리턴하고
 * 정확 한 경우 도로명 조회데이터를 리턴한다.
 */
function newRdNmCheck(newRdNm){
    

    //모든 공백을 제거한다.
    newRdNm = newRdNm.split(' ').join("");
    
    
    var idx1 = newRdNm.lastIndexOf("로");
    
    var idx2 = newRdNm.lastIndexOf("길");
    
    
    if((idx1 == -1) && (idx2 == -1)){
        alert("도로명 + 건물번호를 입력하십시오!\n 검색방법 : 도로명(~로,~길) + 건물번호\n -서울시 송파구 잠실로 51-33 \n 예)'잠실로(도로명) 51-33(건물번호)'\n-서울시 강동구 양재대로 112길 57 \n 예)'양재대로 112길(도로명) 57(건물번호)'");
        return -1;
    }
    
    //로와 길중 가장 뒤에 있는 것을 기준으로 한다.
    //로와 길 뒤에 건물번호가 존재하는지 즉 숫자만 존재하는지 체크한다.
   
    var lstidx = 0 ;

    if(idx1 > idx2 ) {
  
        lstidx = idx1 ;
    }else {
       
        lstidx = idx2 ;
    }


    var tmpRdNmPrx  = newRdNm.substring( 0,lstidx + 1 );
    var tmpRdNmTail  = newRdNm.substring( lstidx+1,newRdNm.length);

    if(tmpRdNmTail != ""){
        // 건물 번호에 '-'가  존재할 수 있으므로 '-'를 제외한 문자가 숫자로 이루어져 있는지 판단해야여 한다.
        var numChkTail = tmpRdNmTail.split('-').join("");
      
        if(isNaN(numChkTail)){
            alert("건물번호는 반드시 숫자만 입력하세요!!");
            return -1;
        }
        newRdNm = tmpRdNmPrx + " " + tmpRdNmTail ;
    }else
        newRdNm = tmpRdNmPrx ;

    return newRdNm;
   
}

  function doReturnNewData(zipCode, zipSn1, zipSn2, zipScn,adr,wpaNm,admzNm){

    document.newZipCodeForm.newZipScn.value = zipScn;
    document.newZipCodeForm.newZipSn01.value = zipSn1;
    document.newZipCodeForm.newZipSn02.value = zipSn2;
    document.newZipCodeForm.newAddr.value = adr;
    document.newZipCodeForm.newWpaNm.value = wpaNm;
    document.newZipCodeForm.newAdmzNm.value = admzNm;        

}

//우편번호를 조회해온다.
function searchNewAdrDtl(){
 
    var wpaCd = document.getElementById("newWpaCode");
    var admCd = document.getElementById("newAdmzCode");
    var newRdNm = document.getElementById("searchRdNm");    


    //우편번호를 조회해온다.
    $.post("<c:url value='/zip/selectNewAdrDtl.do'/>",
            {
                'wpaCd' : wpaCd.value   ,
                'admCd' : admCd.value ,
                'rdwNm': newRdNm.value
            },
            function(data){
                var AdrDtlList=[];
                var items = $(data).find("item");
                var ite = items.size();
                items.each(function(index,element){
                   var object={};
                   var zipCode     = $(this).find("value").eq(0).text();
               
                   var dispZipCode = $(this).find("value").eq(3).text();
                   var zipScn      = $(this).find("value").eq(4).text();
                   var adr         = $(this).find("value").eq(5).text();
                   var wpa       = $(this).find("value").eq(6).text();
                   var admz      = $(this).find("value").eq(7).text();
                   var zip1 = zipCode.substr(0,3);
                   var zip2 = zipCode.substr(3,3);
                
                   object["zipcode"] = zipCode;
                   object["zipSn1"]   = zip1;
                   object["zipSn2"]   = zip2;
                   object["dispzipcode"]= dispZipCode;
                   object["zipScn"] = zipScn;
                   object["adr"] = adr;
                   object["wpaNm"] = wpa,
                   object["admzNm"] = admz;

                   AdrDtlList[index] = object;
                });

                var inHtml = '';
                if(AdrDtlList.length > 0){
                   for(var i= 0 ; i < AdrDtlList.length;i++){

   
                       inHtml = inHtml + '<div class="row">';

                       var zipC = AdrDtlList[i]["zipcode"];
                       var zipS1 = AdrDtlList[i]["zipSn1"];
                       var zipS2 = AdrDtlList[i]["zipSn2"];
                       var zipSc = AdrDtlList[i]["zipScn"];
                       var addr  =AdrDtlList[i]["adr"];
                       var wpaNm = AdrDtlList[i]["wpaNm"];
                       var admzNm = AdrDtlList[i]["admzNm"];

                       inHtml = inHtml + '<input type="hidden" id="zipSn" name="zipSn" value="' + zipC + '">';
                       inHtml = inHtml + '<input type="hidden" id="zipSn1" name="zipSn1" value="' + zipS1 + '">';
                       inHtml = inHtml + '<input type="hidden" id="zipSn2" name="zipSn2" value="' + zipS2 + '">';
                       inHtml = inHtml + '<input type="hidden" id="zipScn" name="zipScn" value="' + zipSc + '">';
                       inHtml = inHtml + '<input type="hidden" id="adr" name="adr" value="' + addr + '">';
                       inHtml = inHtml + '<input type="hidden" id="adr" name="wpaNm" value="' + wpaNm + '">';
                       inHtml = inHtml + '<input type="hidden" id="adr" name="admzNm" value="' + admzNm + '">';
                     
                       inHtml = inHtml + '<div class="code">' + AdrDtlList[i]["dispzipcode"] + '</div>';
                       inHtml = inHtml + '<div class="address" style="color:#252525;"><a href="#" onClick="return doReturnNewData(\'' + zipC + '\',\'' + zipS1+ '\',\'' +zipS2 + '\',\'' + zipSc +'\',\'' +addr + '\',\'' + wpaNm +'\',\'' +admzNm  +'\')">' + addr + '</a></div>';

                       inHtml = inHtml + '</div>';


                   }
                }
                else{
                    inHtml = inHtml + '<div class="code"></div>';
                    inHtml = inHtml + '<div class="address">검색 결과가 없습니다.</div>';
                }
                $("#newRdList").html(inHtml);
            }
        );       
}


function newRdNmCls(){
    var newRdNm = document.getElementById("newRdNm");
  
    if (newRdNm.value  =="도로명 + 건물번호") newRdNm.value = "";

    
}


function chgNewRdNm(){
    var newRdNm = document.getElementById("newRdNm");
    
    if(newRdNm.value == "")  newRdNm.value  = "도로명 + 건물번호";
    
}



function newAddrConfirm(){
    var dong = document.getElementById("dong");
    var ho   = document.getElementById("ho");
    var etcNewRdNm = document.getElementById("etcNewRdNm");
    var newZipSn01 = document.getElementById("newZipSn01");
    var newZipSn02 = document.getElementById("newZipSn02");
    var newAddr =   document.getElementById("newAddr");
    var newZipScn = document.getElementById("newZipScn");
    var newWpaNm =   document.getElementById("newWpaNm");
    var newAdmzNm =   document.getElementById("newAdmzNm");
    
    
    if(dong.value != "") dong.value = dong.value + "동 ";
    if(ho.value !== "") ho.value = ho.value + "호 ";
    
    var etcAddr = dong.value + ho.value + etcNewRdNm.value ;
    

   /* 
    AddrConfirm(newZipScn.value,newZipSn01.value,newZipSn02.value,newAddr.value,etcAddr);
   */

   opener.document.getElementById("zipScn").value =newZipScn.value;
   
   opener.document.getElementById("zipSn01").value = newZipSn01.value;      
   opener.document.getElementById("zipSn02").value = newZipSn02.value;   
       
   opener.document.getElementById("adr").value = htmlCSSReplace(newAddr.value);   
   opener.document.getElementById("dtlAdr").value =htmlCSSReplace(etcAddr);  
  // opener.document.getElementById("wpaNm").value = newWpaNm.value;
  // opener.document.getElementById("admzNm").value = newAdmzNm.value;
      
   
   
   /*
     opener.zipScn.value =newZipScn.value;
     opener.zipSn01.value = newZipSn01.value;      
     opener.zipSn02.value = newZipSn02.value;   
     
     opener.adr.value = newAddr.value;   
     opener.dtlAdr.value =etcAddr;  
     
     opener.wpaNm.value = newWpaNm.value;
     opener.admzNm.value = newAdmzNm.value;     
     */
    //PopUpClose();
    //
       self.close();
    //widnow.close();
    
}





function oldRdNmCls(){
    var oldRdNm = document.getElementById("oldRdNm");
  
    if (oldRdNm.value  =="동명,건물명,우편번호") oldRdNm.value = "";
 
    
}


function chgOldRdNm(){
    var oldRdNm = document.getElementById("oldRdNm");
    
    if(oldRdNm.value == "")  oldRdNm.value  = "동명,건물명,우편번호";
    
}



/*신주소 우편번호를 조회한다*/
function searchOldAdr(){
    
    var wpaCd = document.getElementById("oldWpaCode");
    var admCd = document.getElementById("oldAdmzCode");
    var oldRdNm = document.getElementById("oldRdNm");
    var searchOldZipCode = document.getElementById("searchOldZipCode");
    var searchOldRdNm = document.getElementById("searchOldRdNm");

    
 
    
    if(oldRdNm.value ==""){
        alert("동명,건물명,우편번호를 입력하여 주십시요");
        oldRdNm.focus();
        return ;
    }

    // 검색어가 숫자로만 이루어진 경우 우편번호로 인식한다
    // 그것이 아닌경우 동명,건물명으로 인식한다.
    
    if(!isNaN(oldRdNm.value)){
        searchOldZipCode.value=oldRdNm.value;
        searchOldRdNm.value ="";
        
    }else{
        searchOldZipCode.value = "";
        searchOldRdNm.value= oldRdNm.value
    }    
    searchOldAdrDtl();
    
}

//우편번호를 조회해온다.
function searchOldAdrDtl(){
 
    var wpaCd = document.getElementById("oldWpaCode");
    var admCd = document.getElementById("oldAdmzCode");
    var searchOldRdNm = document.getElementById("searchOldRdNm");    
    var searchOldZipCode = document.getElementById("searchOldZipCode");


    //우편번호를 조회해온다.
    $.post("<c:url value='/zip/selectOldAdrDtl.do'/>",
            {
                'wpaCd' : wpaCd.value   ,
                'admCd' : admCd.value ,
                'searchOldRdNm':searchOldRdNm.value,
                'searchOldZipCode' : searchOldZipCode.value
            },
            function(data){
                var AdrDtlList=[];
                var items = $(data).find("item");
                var ite = items.size();
                items.each(function(index,element){
                   var object={};
                   var zipCode     = $(this).find("value").eq(0).text();

                   var dispZipCode = $(this).find("value").eq(3).text();
                   var zipScn      = $(this).find("value").eq(4).text();
                   var adr         = $(this).find("value").eq(5).text();
                   var wpa       = $(this).find("value").eq(6).text();
                   var admz      = $(this).find("value").eq(7).text();
                   var zip1 = zipCode.substr(0,3);
                   var zip2 = zipCode.substr(3,3);
           
                   object["zipcode"] = zipCode;
                   object["zipSn1"]   = zip1;
                   object["zipSn2"]   = zip2;
                   object["dispzipcode"]= dispZipCode;
                   object["zipScn"] = zipScn;
                   object["adr"] = adr;
                   object["wpaNm"] = wpa,
                   object["admzNm"] = admz;

                   AdrDtlList[index] = object;
                });

                var inHtml = '';
                if(AdrDtlList.length > 0){
                   for(var i= 0 ; i < AdrDtlList.length;i++){

   
                       inHtml = inHtml + '<div class="row">';

                       var zipC = AdrDtlList[i]["zipcode"];
                       var zipS1 = AdrDtlList[i]["zipSn1"];
                       var zipS2 = AdrDtlList[i]["zipSn2"];
                       var zipSc = AdrDtlList[i]["zipScn"];
                       var addr  =AdrDtlList[i]["adr"];
                       var wpaNm = AdrDtlList[i]["wpaNm"];
                       var admzNm = AdrDtlList[i]["admzNm"];
                       
                       
                       inHtml = inHtml + '<input type="hidden" id="zipSn" name="zipSn" value="' + zipC + '">';
                       inHtml = inHtml + '<input type="hidden" id="zipSn1" name="zipSn1" value="' + zipS1 + '">';
                       inHtml = inHtml + '<input type="hidden" id="zipSn2" name="zipSn2" value="' + zipS2 + '">';
                       inHtml = inHtml + '<input type="hidden" id="zipScn" name="zipScn" value="' + zipSc + '">';
                       inHtml = inHtml + '<input type="hidden" id="adr" name="adr" value="' + addr + '">';
                       inHtml = inHtml + '<input type="hidden" id="adr" name="wpaNm" value="' + wpaNm + '">';
                       inHtml = inHtml + '<input type="hidden" id="adr" name="admzNm" value="' + admzNm + '">';
                     
                       inHtml = inHtml + '<div class="code">' + AdrDtlList[i]["dispzipcode"] + '</div>';
                       inHtml = inHtml + '<div class="address" style="color:#252525;"><a href="#" onClick="return doReturnOldData(\'' + zipC + '\',\'' + zipS1+ '\',\'' +zipS2 + '\',\'' + zipSc +'\',\'' +addr + '\',\'' + wpaNm +'\',\'' +admzNm +'\')">' + addr + '</a></div>';

                       inHtml = inHtml + '</div>';


                   }
                }
                else{
                    inHtml = inHtml + '<div class="code"></div>';
                    inHtml = inHtml + '<div class="address">검색 결과가 없습니다.</div>';
                }
                $("#oldRdList").html(inHtml);
            }
        );       
}

function doReturnOldData(zipCode, zipSn1, zipSn2, zipScn,adr, wpaNm, admzNm){

    document.oldZipCodeForm.oldZipScn.value = zipScn;
    document.oldZipCodeForm.oldZipSn01.value = zipSn1;
    document.oldZipCodeForm.oldZipSn02.value = zipSn2;
    document.oldZipCodeForm.oldAddr.value = adr;
    document.oldZipCodeForm.oldWpaNm.value = wpaNm;
    document.oldZipCodeForm.oldAdmzNm.value = admzNm;
    
}


function oldAddrConfirm(){

    var oldZipScn = document.getElementById("oldZipScn");
    var etcOldRdNm = document.getElementById("etcOldRdNm");
    var oldZipSn01 = document.getElementById("oldZipSn01");
    var oldZipSn02 = document.getElementById("oldZipSn02");
    var oldAddr =   document.getElementById("oldAddr");
 //   var oldWpaNm =   document.getElementById("oldWpaNm");
 //   var oldAdmzNm =   document.getElementById("oldAdmzNm");
    
 
    

/*
    AddrConfirm(oldZipScn.value,oldZipSn01.value,oldZipSn02.value,oldAddr.value,etcOldRdNm.value);
    PopUpClose();
*/

    opener.parent.document.getElementById("zipScn").value =oldZipScn.value;
    
    opener.parent.document.getElementById("zipSn01").value = oldZipSn01.value;      
    opener.parent.document.getElementById("zipSn02").value = oldZipSn02.value;   
        
    opener.parent.document.getElementById("adr").value = htmlCSSReplace(oldAddr.value);   
    opener.parent.document.getElementById("dtlAdr").value =htmlCSSReplace(etcOldRdNm.value);  
  //  opener.parent.document.getElementById("wpaNm").value = oldWpaNm.value;
  //  opener.parent.document.getElementById("admzNm").value = oldAdmzNm.value;
    
    self.close();
    
}

function htmlCSSReplace(str){
    str = str.replaceAll("<","&lt;");//HTML tag를 모두 제거
    str = str.replaceAll(">","&gt;");
    str = str.replaceAll("&lt;p&gt;", "<p>");
    str = str.replaceAll("&lt;P&gt;", "<P>");
    str = str.replaceAll("&lt;br&gt;", "<br>");
    str = str.replaceAll("&lt;BR&gt;", "<BR>");
    
    return str;
}






</script>

</head>
<body>

<div id="popup-wrap" class="pop-w640">
    <div id="popup-header">
        <h1><a href="/kr/index.jsp"><img src="/kr/images/popup/h1_logo.gif" alt="HYUNDAI" /></a></h1>
    </div>
    <div id="popup-contents">    
    <form method="post" action="" name="newZipCodeForm" id="newZipCodeForm" onsubmit="return false" >
        <input type="hidden" id="newZipScn" name="newZipScn" value="">
        <input type="hidden" id="searchRdNm" name="searchRdNm" value="">
        <input type="hidden" id="newWpaNm" name="newWpaNm" value="">
        <input type="hidden" id="newAdmzNm" name="newAdmzNm" value="">

        <div id="newZipCode" name="newZipCode" >
            <div class="tab-wrap02 zipcode-tab">
                <ul>
                    <li class="on"><a href="javascript:MenuTgl(1);"><img src="/kr/images/popup/tab_zipcode01_over.gif" alt="새주소(도로명주소) 검색" /></a></li>
                    <li><a href="javascript:MenuTgl(2);"><img src="/kr/images/popup/tab_zipcode02_out.gif" alt="구주소(지번주소) 검색" /></a></li>
                </ul>
            </div>
            <div class="tab-wrap02-cont">
                <h2 class="tit-type02"><img src="/kr/images/popup/h2_zipcode01.gif" alt="기본주소 입력" /></h2>
                <p><img src="/kr/images/popup/h2_zipcode01_desc.gif" alt="도로명과 건물번호를 검색어란에 입력 후 검색하세요." /></p>
                <p class="subsection03"><img src="/kr/images/popup/txt_zipcode01.gif" alt="검색방법 : 도로명 (~로, ~길) + 건물번호" /></p>
                <p class="zipcode-search-tip">주소가 검색되지 않는 경우는 행정안전부 도로명주소안내 시스템 <b><a href="http://juso.go.kr" target="_blank" class="link-type02">(http://juso.go.kr)</a></b> 에서 확인하시기 바랍니다.</p>
    
                <div class="boardwrite-wrap02 subsection03">
                    <table summary="시도, 시군구, 검색어">
                    <caption>기본주소 정보 작성</caption>
                    <colgroup>
                        <col width="17%" />
                        <col width="33%" />
                        <col width="17%" />
                        <col width="33%" />
                    </colgroup>
                    <tbody>
                    <tr>
                        <th scope="row"><img src="/kr/images/popup/txt_zipcode02.gif" alt="시도" /></th>
                            <td  >
                                <select  style="width:145px;" id="newWpaCode" name="newWpaCode" onChange="searchNewAdmz()">
                                    <option value="">선택</option>
                                </select>
                            </td>
                        <th scope="row">
                        <div name ="newCodeYn1" id ="newCodeYn1" style="">
                            <img src="/kr/images/popup/txt_zipcode03.gif" alt="시군구" />
                        </div>
                        </th>
                        <td>
                        <div name ="newCodeYn2" id ="newCodeYn2" style="">
                            <select   style="width:145px;" id="newAdmzCode" name="newAdmzCode" >
                                <option value="">선택</option>
                            </select>
                        </div>
                        </td>
                    </tr>
                    <tr>
                        <th scope="row"><img src="/kr/images/popup/txt_zipcode04.gif" alt="검색어" /></th>
                        <td colspan="3">
                            <input type="text" class="txt2" style="width:342px;" value="도로명 + 건물번호" id="newRdNm" name="newRdNm" onblur="return chgNewRdNm()" onClick="newRdNmCls()"/>
                            <input type="image" src="/kr/images/common/button/btn_search.gif" alt="SEARCH" onClick="searchNewAdr()"/>
                        </td>
                    </tr>
                    </tbody>
                    </table>
                </div>
                <div class="code-result-view subsection03">
                    <div class="row-wrap" name ="newRdList" id ="newRdList">
                        <div class="row" >
                             <div class="code"></div>
                           <div class="address">검색어를 입력하십시요</div>                       
                        </div>
                    </div>
                </div>
            
                <div  id="new_Sub" name="new_sub" >
                    <h2 class="tit-type02 subsection"><img src="/kr/images/popup/h2_zipcode02.gif" alt="상세주소 입력 " /></h2>
                    <p><img src="/kr/images/popup/h2_zipcode02_desc.gif" alt="기본주소를 선택 후 상세주소를 입력해주세요" /></p>
                    <p class="zipcode-search-tip">아파트(동,호)나 아파트 이외 중하나를 선택하여 내용을 입력하세요.</p>
                    <div class="boardwrite-wrap02 subsection03">
                        <table summary="시도, 시군구, 검색어">
                        <caption>기본주소 정보 작성</caption>
                        <colgroup>
                            <col width="17%" />
                            <col width="83%" />
                        </colgroup>
                        <tbody>
                        <tr>
                            <th scope="row"><img src="/kr/images/global_menu/txt_global_menu02_04_07.gif" alt="우편번호 주소 상세주소" /></th>
                            <td>
                                <input type="text" class="txt" style="width:52px;" id="newZipSn01"  name="newZipSn01" value="" readonly />
                                -
                                <input type="text" class="txt" style="width:52px;" id="newZipSn02" name="newZipSn02" value="" readonly />
                                <p class="sect">
                                    <input type="text" class="txt" style="width:310px;" id="newAddr" name="newAddr" value="" readonly />
                                </p>
        
                            </td>                
                        </tr>
                        <tr>
                            <th scope="row"><img src="/kr/images/popup/txt_zipcode05.gif" alt="시도" /></th>
                            <td>
                                <input type="text"  style="width:150px; margin-right:5px;" id="dong" name="dong"  value =""/>
                                동
                                <input type="text"  style="width:150px; margin:0 5px;" id="ho" name="ho"  value=""/>
                                호
                            </td>
                        </tr>
                        <tr>
                            <th scope="row"><img src="/kr/images/popup/txt_zipcode06.gif" alt="아파트 이외" /></th>
                            <td>
                                <input type="text" class="txt2" style="width:336px;" id="etcNewRdNm" name="etcNewRdNm" value="" />
                            </td>
                        </tr>
                        </tbody>
                        </table>
                    </div>
                </div>    
                <div class="btnwrap">
                    <a href="#"><img src="/kr/images/popup/btn_confirm03.gif" alt="확인" onClick="newAddrConfirm()" /></a>
                    <a href="#"><img src="/kr/images/popup/btn_cancel.gif" alt="취소" onClick="PopUpClose()"/></a>
                </div>
            </div>
        </div>
    </form>
    <form method="post" action="" name="oldZipCodeForm" id="oldZipCodeForm" onsubmit="return false" >  
        <input type="hidden" id="searchOldZipCode" name="searchOldZipCode" value="">   
        <input type="hidden" id="searchOldRdNm"    name="searchOldRdNm" value="">
        <input type="hidden" id="oldZipScn" name="oldZipScn" value="">
        <input type="hidden" id="oldWpaNm" name="oldWpaNm" value="">
        <input type="hidden" id="oldAdmzNm" name="oldAdmzNm" value="">
        
        <div name="oldZipCode" id="oldZipCode">       
            <div class="tab-wrap02 zipcode-tab">
                <ul>
                    <li><a href="javascript:MenuTgl(1);"><img src="/kr/images/popup/tab_zipcode01_out.gif" alt="새주소(도로명주소) 검색" /></a></li>
                    <li class="on"><a href="javascript:MenuTgl(2);"><img src="/kr/images/popup/tab_zipcode02_over.gif" alt="구주소(지번주소) 검색" /></a></li>
                </ul>
            </div>
            <div class="tab-wrap02-cont">
                <h2 class="tit-type02"><img src="/kr/images/popup/h2_zipcode01.gif" alt="기본주소 입력" /></h2>
                <p><img src="/kr/images/popup/h2_zipcode01_desc02.gif" alt="우편번호 또는 동/읍/면 명을 입력후 검색하세요." /></p>
                <p class="subsection03"><img src="/kr/images/popup/txt_zipcode07.gif" alt="검색방법 : 동명 또는 우편번호를 입력하세요." /></p>
    
                <div class="boardwrite-wrap02 subsection03">
                    <table summary="시도, 시군구, 검색어">
                    <caption>기본주소 정보 작성</caption>
                    <colgroup>
                        <col width="17%" />
                        <col width="33%" />
                        <col width="17%" />
                        <col width="33%" />
                    </colgroup>
                    <tbody>
                    <tr>
                        <th scope="row"><img src="/kr/images/popup/txt_zipcode02.gif" alt="시도" /></th>
                        <td>
                            <select  style="width:145px;" id="oldWpaCode" name="oldWpaCode"   onChange="searchOldAdmz()">
                                <option value="">전체</option>
                            </select>
                        </td>
                        <th scope="row">
                            <div name ="oldCodeYn1" id ="oldCodeYn1" style="">
                                <img src="/kr/images/popup/txt_zipcode03.gif" alt="시군구" />
                            </div>
                        </th>
                        <td>
                            <div name ="oldCodeYn2" id ="oldCodeYn2" style="">
                                <select  style="width:145px;" id="oldAdmzCode" name="oldAdmzCode" >
                                    <option value="">전체</option>
                                </select>
                            </div>   
                        </td>
                    </tr>
                    <tr>
                        <th scope="row"><img src="/kr/images/popup/txt_zipcode04.gif" alt="검색어" /></th>
                        <td colspan="3">
                            <input type="text" class="txt2" style="width:342px;" value="동명,건물명,우편번호" id="oldRdNm" name="oldRdNm" onblur="return chgOldRdNm()" onClick="oldRdNmCls()" />
                            <input type="image" src="/kr/images/common/button/btn_search.gif" alt="SEARCH" onClick="searchOldAdr()"/>
                        </td>
                    </tr>
                    </tbody>
                    </table>
                </div>
                <div class="code-result-view subsection03">
                    <div class="row-wrap" name ="oldRdList" id ="oldRdList">
                        <div class="row">
                            <div class="code"></div>
                            <div class="address">검색어를 입력하세요</div>
                        </div>
                    </div>
                </div>
                <div  id="old_Sub" name="old_sub" >
                    <h2 class="tit-type02 subsection"><img src="/kr/images/popup/h2_zipcode02.gif" alt="상세주소 입력 " /></h2>
                    <p><img src="/kr/images/popup/h2_zipcode02_desc.gif" alt="기본주소를 선택 후 상세주소를 입력해주세요" /></p>
                    <div class="boardwrite-wrap02 subsection03">
                        <table summary="시도, 시군구, 검색어">
                        <caption>기본주소 정보 작성</caption>
                        <colgroup>
                            <col width="17%" />
                            <col width="83%" />
                        </colgroup>
                        <tbody>
                        <tr>
                            <th scope="row"><img src="/kr/images/global_menu/txt_global_menu02_04_07.gif" alt="우편번호 주소 상세주소" /></th>
                            <td>
                                <input type="text" class="txt" style="width:52px;" id="oldZipSn01"  name="oldZipSn01" value="" readonly />
                                -
                                <input type="text" class="txt" style="width:52px;" id="oldZipSn02" name="oldZipSn02" value="" readonly />
                                <p class="sect">
                                    <input type="text" class="txt" style="width:310px;" id="oldAddr" name="oldAddr" value="" readonly />
                                </p>
        
                            </td>                
                        </tr>                
                        <tr>
                            <th scope="row"><img src="/kr/images/popup/txt_zipcode08.gif" alt="상세주소" /></th>
                            <td>
                                <input type="text" class="txt2" style="width:335px;" id="etcOldRdNm" name="etcOldRdNm" value=""/>
                            </td>
                        </tr>
                        </tbody>
                        </table>
                    </div>
                    <div class="btnwrap">
                        <a href="#"><img src="/kr/images/popup/btn_confirm03.gif" alt="확인" onClick="oldAddrConfirm()" /></a>
                        <a href="#"><img src="/kr/images/popup/btn_cancel.gif" alt="취소"  onClick="PopUpClose()" /></a>
                    </div>
                </div>
            </div>
        </div>
    </form>
    </div>
</div>

</body>

</html>